Replication archive for Graeme Blair, Darin Christensen, and Aaron Rudkin, 
"Do commodity price shocks cause armed conflict? Evidence from a meta-analysis,"
American Political Science Review, 2020.

Table of Contents:
- Basic Replication Details
- Files included
- Not included
- SM Table A.12
- Using `renv`

Basic Replication details:
- Replication constructed using R 4.0.2 on September 26th, 2020
- The replication archive includes support for the "renv" package, which
  will allow you to run the replication code using the exact versions of
  all required packages used to generate the paper. See section "renv" for
  details.
- Supplementary Materials Table A.12 replication requires external
  replication materials for Guardado (2018) and Carreri and Dube (2017). See 
  section "SM Table A.12" below for details.
- Paper Figure 1, SM Figure A.3, and SM Table A.12 all depend on the file
  `data/tab-3-meta-estimates.RDS`, which is generated by 
  `code/tab-3-meta-analysis.R`; the archive includes this file pre-generated. 
- All scripts that generate tables output LaTeX for tables in `tables/`.
- All scripts that generate figures output PDFs for figures in `figures/`.
- Windows users may encounter cosmetic errors related to figure text rendering
  or font embedding.

Files Included:
- code/: Folder containing all replication code
   - code/helper-functions/_functions.R: Miscellaneous helper functions
   - code/helper-functions/effect-size-helpers.R: Helpers used to extract and
     computer SM Table A.12.
   - code/helper-functions/meta-analysis-helpers.R: Code which runs our meta-
     analyses and bootstraps Pooled estimates. Used in Table A3 and SM Tables 
     A.8, A.10, A.11, A.13, and A.14.
   - code/helper-functions/meta-ggplot-theme.R: Aesthetic theme used for
     figure outputs.
   
   - All remaining files generate specific tables or figures:
   - code/fig-1-effect-size.R
   - code/fig-2-gapmap-comm-cont.R
   - code/sm-fig-a1-studies-citations.R
   - code/sm-fig-a2-prisma-flowchart.R: See "Not Included" below for details
   - code/sm-fig-a3-effect-sizes-nosuppress.R
   - code/sm-fig-a4-pcurve.R
   - code/sm-fig-a5-funnel.R
   - code/sm-tab-a1-commodity-type.R
   - code/sm-tab-a3-a6-cites.R: This file generates both SM Tab A.3 and Tab A.6
   - code/sm-tab-a4-data-concentration.R
   - code/sm-tab-a5-sample-metadata-comparison.R
   - code/sm-tab-a7-partial-r.R
   - code/sm-tab-a8-meta-analysis-leaveoneout.R
   - code/sm-tab-a9-conflict-commodity.R
   - code/sm-tab-a10-meta-analysis-areal-unit.R
   - code/sm-tab-a11-meta-analysis-drop-timevarying.R
   - code/sm-tab-a12-effect-size-interpretation.R: See "SM Table A.12" below for
     more details
   - code/sm-tab-a13-meta-analysis-winsorize-effects.R
   - code/sm-tab-a14-meta-analysis-clip-weights.R
   - code/sm-tab-a15-meta-regression-analysis.R
   - code/tab-2-filtering.R
   - code/tab-3-meta-analysis.R

- data/: Folder containing all data
    - data/country-metadata/: Externally sourced metadata for SM Table A.5.
    - data/country-metadata/aggregated-polity.csv: POLITY5 scores
    - data/country-metadata/cow-interstate.csv: List of COW interstate conflicts
    - data/country-metadata/cow-intrastate.csv: List of COW intrastate conflicts
    - data/country-metadata/web-gdp.csv: World Bank dataset
      "NY.GDP.PCAP.KD" (GDP per cap, constant 2011 USD)
    - data/country_metadata/web-gini.csv: World Bank dataset
      "SI.POV.GINI" ("GINI Index (World Bank Estimate)")
    - data/effect-size-interpretation/Guardado/: Blank folder for placement
      of Guardado (2018) replication data, see "SM Table A.12" section below.
    - data/effect-size-interpretation/Carreri_Dube/: Blank folder for placement
      of Carreri and Dube (2017) replication data, see "SM Table A.12" section 
      below.
    - data/bibliography-df.csv: Basic study metadata used to construct SM tables
      A.3 and A.6.
    - data/early-filter-results.csv: Summary of early stage study filtering
      counts, used to construct Table 2 and SM Table A.2.
    - data/meta-df.csv: The main meta-analysis input, including study data, 
      study metadata, standardization information.
    - data/study-country-year-metadata.csv: Study-country-year information and
      metadata used to generate SM Tables A.4 and A.5.
    - data/study-citation-counts.csv: Study and citation counts by year, used 
      to generate SM Figure A.1
    - data/tab3-meta-estimates.RDS: The results of code/tab-3-meta-analysis.R;
      included because it is used as input for Figure 1, SM Figure A.3, and
      SM Table A.12.
    
- figures/: Folder of output figures
- renv/: See "Using 'renv'" section below
- tables/: Folder of output tables
- README.txt: This file.
- renv.lock: See "Using 'renv'" section below
- replication.Rproj: Open to ensure correct working directory
- .Rprofile: See "Using 'renv'" section below

Not Included:
- We do not include files to generate Table 1 (Hypotheses), SM Table A.2 
  (Coding Mineral Studies), and Table A.16 (PRISMA Checklist), all of which
  do not require data analysis.
- SM Figure A.2 (PRISMA Flowchart) is created manually in LaTeX using the data
  generated by code/sm-fig-a2-prisma-flowchart.R

SM Table A.12:
- SM Table A.12 provides an interpretation of meta-analyzed effect sizes using
  results from Guardado (2018) and Carreri and Dube (2017) as a guide.
- We do NOT include the replication archives for these papers, which are 
  required in order to generate Table A.12.
- Carreri and Dube (2017) replication materials are located on dataverse:
  https://dataverse.harvard.edu/dataset.xhtml?persistentId=doi%3A10.7910%2FDVN%2FL17KS1
  Harvard Dataverse, V1. Note: Download the entire ZIP ("Original Format Zip"). 
- Download and extract this replication archive, placing the contents in:
  /data/effect-size-interpretation/Carreri_Dube/. Specifically, the file:
  /data/effect-size-interpretation/Carreri_Dube/Carreri_Dube_replication_main.dta
  must be present.
- Guardado (2018) replication materials are available from journal:
  https://www.sciencedirect.com/science/article/abs/pii/S0305750X18302353
  Download the `replication_landtenure.zip` file linked under "Research Data".
- Download and extract this replication archive, placing the contents in:
  /data/effect-size-interpretation/Guardado/. Specifically, the file:
  /data/effect-size-interpretation/Guardado/12_Data/maindata.dta must be 
  present.
- /code/sm-tab-a12-effect-size-interpretation.R will error if either file
  is missing.

Using 'renv':
- Package updates may break code or change numerical estimates. In order to 
  ensure perfect replication, use the exact package versions used to produce
  the paper.
- To make this task easier, we include data necessary to use 'renv'. 'renv' is
  a R library which maintains parallel versions of R packages to ensure that 
  all package versions match expectations.
- Opening 'replication.Rproj' should trigger the 'renv' activation. 'renv' 
  should install itself. The following text should appear:
  * Project '<hard-drive-path>' loaded. [renv 0.12.0]
- You may need to run the command `renv::restore()` to synchronize package
  versions accordingly.